package com.jdd.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jdd.dao.entity.TArea;
import com.jdd.dao.entity.TProject;
import com.jdd.dao.vo.AreaNum;
import com.jdd.modules.people.vo.AreaSearchVo;
import com.jdd.modules.people.vo.AreaVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 区域表 Mapper 接口
 * </p>
 *
 * @author zly
 * @since 2022-03-23
 */
public interface TAreaMapper extends BaseMapper<TArea> {

    /*area列表基本信息查询*/
    IPage<AreaVo> selectAreaVoPage(Page<AreaVo> page,@Param("areaSearchVo") AreaSearchVo areaSearchVo,@Param("projectCodes")List<String> projectCodes);

    List<TArea> selectByParentId(@Param("parentId")String id);

    int countByParentId(@Param("parentId")String  id);

    List<TArea> selectChild(@Param("parentCode")String parentCode);

    List<TArea> selectByProjectId(@Param("id")String id);

    TProject getParent(@Param("parentId") String parentId);

    List<AreaNum> selectAreaNum(@Param(value = "areaIdList") List<String> areaIdList);

//    String getLastCreateAreaOrgCode(@Param("sysProjectCode") String sysProjectCode);

//    String getOrgCodeLastCreateArea();
}
